package org.stone.project.securityInterface.sysEnum;

/**
 * 权限关系枚举
 */
public enum PermissionRelEnum {
    AND(1,"且"),
    OR(1,"或"),
    NOT(1,"非"),
    ;
    private Integer code;
    private String describStr;

    PermissionRelEnum(Integer code, String describStr) {
        this.code = code;
        this.describStr = describStr;
    }


    public Integer getCode() {
        return code;
    }

    public String getDescribStr() {
        return describStr;
    }


    /**
     * 根据code获取实例
     * @param code
     * @return
     */
    public static PermissionRelEnum getInstance(Integer code){
        if (code == null)
            return null;
        for (PermissionRelEnum value : values()) {
            if (value.getCode() == code)
                return value;
        }
        return null;
    }
}
